<template>
    <div class="app-container">
        <el-form :inline="true" class="demo-form-inline">
            <el-form-item label="日期">
                <el-date-picker 
                v-model="day"
                type="date"
                placeholder="选择需要统计的日期"
                value-format="yyyy-MM-dd"
                >
                </el-date-picker>
                <el-button type="primary" @click="create" style="margin-left:20px">生成</el-button>

            </el-form-item>
        </el-form>
    </div>
</template>
<script>
import Statics from '@/api/statics'
export default {
    data(){
        return{
            day:'',
        }
    },
    methods:{
        create(){ //生成统计数据
          Statics.createStaticsByDate(this.day).then(res=>{
            if(res.code===20000){
                this.$message.success(res.message)
            }
          })
        }
    }
}
</script>
